package top.xxyu.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;
//@ControllerAdvice
public class ExceptionHanlder {

//	@Override
//	public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
//			Exception ex) {
//		ModelAndView view = new ModelAndView();
//		if (ex instanceof UnauthorizedException) {
//			view.setViewName("mobile/login");
//		}
//		return view;
//	}
	@ExceptionHandler(Exception.class)
	public ModelAndView defualtErrorHanlder(){
		ModelAndView view = new ModelAndView();
			view.setViewName("mobile/login");
		return view;
	}

}
